package com.spider.interface3;

public class Test {
    public static void main(String[] args) {
        //目标：完成接口的小案例。
        //准备学生数据
        Student[] allStudent = new Student[5];
        allStudent[0] = new Student("小王",'男',80);
        allStudent[1] = new Student("小张",'女',90);
        allStudent[2] = new Student("小李",'男',70);
        allStudent[3] = new Student("小赵",'女',60);
        allStudent[4] = new Student("小郑",'男',80);

        //提供两套任务实现方案，支持解耦合。
        ClassDataInter cdi = new ClassDataImpl1( allStudent);
        cdi.printAllStudentInfos();
        cdi.printAverageScore();
        System.out.println("===================");
        cdi = new ClassDataImpl2( allStudent);
        cdi.printAllStudentInfos();
        cdi.printAverageScore();
    }
}
